The present invention relates to an adaptive quantizer, an adaptive quantization method and an adaptive quantization program. The present invention particularly relates an adaptive quantizer, an adaptive quantization method and an adaptive quantization program in which a quantization step size is controlled based on activities in pictures under the MPEG (Moving Picture Experts Group Phase 2)-2 specification.
An internationally standardized specification MPEG-2 is a technique for efficiently coding moving pictures carried by video signals, such as TV signals.
The MPEG-2 specification includes two fundamental techniques: motion-compensated prediction and transform coding. The motion-compensated prediction produces prediction errors based on the amount of motion, referred to as motion victors. The motion victors are obtained per macroblock of 16×16 pixels of a picture frame of moving pictures and between a target picture frame to be coded and a reference picture frame temporally apart from the target frame by several frames. The transform coding compresses the amount of data of the prediction errors or the target frame with DCT (Discrete Cosign Transform).
Under the MPEG-2 specification, moving pictures of a video signal are processed per GOP (Group of Pictures): I-pictures (intra-coded pictures), P-pictures (predictive-coded pictures) and B-pictures (bidirectionally predictive-coded pictures). The I-pictures are coded independently, entirely without reference to other pictures. The P-pictures obtain predictions from temporally preceding I- or P-pictures in GOP. The B-pictures obtain predictions from the nearest preceding and/or upcoming I- or P-pictures in GOP.
The I-pictures undergo DCT directly. In contrast, the P- and B-pictures undergo DCT indirectly, or prediction errors undergo DCT, which are obtained from I- or P-pictures through motion-compensated prediction.
Transform coefficients obtained through DCT for these pictures are quantized followed by variable-length coding to the quantized transform coefficients, motion vectors and other additional information, thus a bitstream being obtained. The bitstream is temporarily stored in a buffer before being output.
Adaptive quantization based on visual perception is achieved with a quantization step size obtained based on buffer fullness (the amount of generated codes) and adjusted according to activities detected for pictures carried by an input video signal. The activity indicates that a picture has strong edge portions or other portions where rapid intensity changes occur, or smooth portions where small intensity changes occur.
The quantized transform coefficients undergo dequantization and then inverse-DCT, thus a locally-decoded signal being produced. The locally-decoded signal is added to a motion-compensated predictive signal gained by motion-compensated prediction. The resultant signal is delayed by several frames to be used as a reference picture in motion-compensated prediction for P- and B-picture coding.
The MPEG-2 compliant encoding technique described above is variable-length coding in which the amount of generated codes (bit rate) per unit of time is not constant.
Adaptive quantization provides rate control in which the bit rate is regulated with a quantization scale factor which is adjusted per macroblock.
A known adaptive quantization technique based on visual perception id disclosed, for example, in International Publication No. WO2002/080574. Adaptive quantization is performed based on activities obtained under MPEG-2 TM-5 (Test Model 5), with suppression of mosquito noises in macroblocks having edge portions. Edge and float portions of a picture are processed in the same way under the known technique. Mosquito noises are inevitably almost equally suppressed for the edge and flat portions even if the former has larger noises than the latter. This leads to insufficient suppression of mosquito noises in the edge portion.
Another known adaptive quantization technique based on visual perception is disclosed, for example, in Japanese Un-examined Patent Publication No. 05(1993)-137132. Adaptive quantization is performed based on activities of a picture to be coded and a reference picture, however, no suppression of mosquito noises in edge portions being achieved.